<script src="{{ getAssets }}js/amazeui.datatables.min.js?v={{ assets_version }}"></script>
<script>
	var tables = $('#dataTables').DataTable({
		"sAjaxSource" : location.href
		,"bLengthChange": false
		,"fnServerData" : function(sSource, aoData, fnCallback) {
			var queryParams = checkQueryTableData(aoData);
			$.post(sSource, JSON.stringify(queryParams),function(resp) {
				fnCallback(resp);
			},'json')
		}
		,columns: [
            {"bSortable": false, render:function(data, type, full, meta) {
                    return productGroupName(full.Products);
            }}
            ,{"bSortable": false, render:function(data, type, full, meta) {
                    return full.UnitPrice;
            }}
            ,{"bSortable": false, render:function(data, type, full, meta) {
                    return full.Amount;
            }}
            ,{"bSortable": false, render:function(data, type, full, meta) {
                    return full.TotalPrice;
                }}
            ,{"bSortable": false, render:function(data, type, full, meta) {
                    return full.CollectNum;
                }}
            ,{"bSortable": false, render:function(data, type, full, meta) {
                    return full.CollectDate ? timetrans(full.CollectDate) : '';
                }}
		]
		,"aLengthMenu":[20, 50, 100, 200]
		,'bLengthChange': true
		,"serverSide": true
		,"bPaginate" : true
		,"bFilter" : false	//是否启动过滤、搜索功能 
		,"bInfo" : true //是否显示页脚信息，DataTables插件左下角显示记录数
		,"bProcessing" : true //DataTables载入数据时，是否显示‘进度’提示  
		  
	});
	$('#refresh').click(function(){
        $("#dataTables").dataTable().fnDraw(false);
		return false;
	});

</script>